package note1.chapters.util;

public class Range {
	public static int[] range(int n) {
		int[] result = new int[n];
		for (int i = 0; i < result.length; i++) {
			result[i] = i;
		}
		return result;
	}

	public static int[] range(int start, int end) {
		int length = end - start;
		int[] result = new int[length];
		for (int i = 0; i < result.length; i++) {
			result[i] = start + i;
		}
		return result;
	}

	public static int[] range(int start, int end, int step) {
		int length = (end - start) / step;
		int[] result = new int[length];
		for (int i = 0; i < result.length; i++) {
			result[i] = start + i * step;
		}
		return result;
	}
}
